﻿using System;
using System.IO;
using System.Net;
using System.Text;

namespace DisplayDemo
{
    public sealed class WebUtils
    {
        public string DoGet(string url)
        {
            try
            {
                HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
                req.Method = "GET";
                req.ContentType = "application/x-www-form-urlencoded;";

                HttpWebResponse rsp = (HttpWebResponse)req.GetResponse();

                using (Stream stream = rsp.GetResponseStream())
                {
                    using (StreamReader reader = new StreamReader(stream, Encoding.UTF8))
                    {
                        return reader.ReadToEnd();
                    }
                }
            }
            catch
            {
                return String.Empty;
            }

        }
    }
}
